<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateActivityMallLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activity_mall_log', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户id')->index();
            $table->tinyInteger('goods_id')->default(0)->comment('商品id');
            $table->tinyInteger('time_limit')->default(0)->comment('赠送天数');
            $table->tinyInteger('activity_type')->default(1)->comment('活动类型');
            $table->tinyInteger('goods_type')->default(1)->comment('商品类型：0：其他 1：头饰 2：座驾  3：气泡 4 名片 5 戒指');
            $table->tinyInteger('send_type')->default(1)->comment('赠送类型');
            $table->timestamp('created_at')->default(\Illuminate\Support\Facades\DB::raw("CURRENT_TIMESTAMP"))->comment('创建时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activity_mall_log');
    }
}
